/*
 * @Author: YuanSong 
 * @Date: 2021-12-02 11:51:51 
 * @Last Modified by: YuanSong
 * @Last Modified time: 2021-12-02 12:01:23
 */
//用来实现数据库表的映射

const Sequelize = require('sequelize');
const db = require('../db');

//定义model
const User = db.define('User',{
    id:{type:Sequelize.INTEGER,primaryKey:true,allowNull:false,autoIncrement:true},//主键
    phone:{type:Sequelize.STRING(20),allowNull:false}, //手机号
    nick_name:{type:Sequelize.STRING(20)}, // 昵称
    theme:{type:Sequelize.STRING(20)}, //使用主题
    password:{type:Sequelize.STRING(20),allowNull:false}, //密码
},{
    underscored:true, //是否支持驼峰
    tableName: 'user', //MySQL数据库表名
});
module.exports = User;